﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Company.Web.Areas.Manage.Models.ManagerModels.IndexModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	用户管理
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
    <%=Html.ActionLink("新增", "add", null, new { @class = "a2" }) %>
    <table width="100%" class="table">
        <tr class="bar">
            <th>登录名</th>
            <th>状态</th>
            <th>是否在线</th>
            <th>操作</th>
        </tr>
        <% foreach (var item in Model.Admins) %>
        <% { %>
        <tr>
            <td><%=item.LoginName %></td>
            <td><%=item.State.Name() %></td>
            <td><%=item.InLine ? "在线" : ""%></td>
            <td>
                <%=Html.ActionLink("编辑", "edit", new { ID=item.ID.ToString("N") }, new { @class = "a2" }) %>
                <% if (!item.IsCurrent) %>
                <% { %>
                <% if (item.State == AdminState.Disabled) %>
                <% { %>
                <%=Html.ActionLink("解除", "state", new { id = AdminState.Enabled, a = item.ID.ToString("N") }, new { @class = "a2" }) %>
                <% } %>
                <% else %>
                <% { %>
                <%=Html.ActionLink("锁定", "state", new { id = AdminState.Disabled, a = item.ID.ToString("N") }, new { @class = "a2" }) %>
                <% } %>
                <%=Html.ActionLink("删除", "del", new { ID = item.ID.ToString("N") }, new { @class = "a2" }) %>
                <% } %>

            </td>
        </tr>
        <% } %>
    </table>
</div>
</asp:Content>
